﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;


namespace DAL
{
    public class DAL_NhanVien
    {
        Connect da = new Connect();
        public DataTable shownhanvien()
        {
            string sql = "select * from NhanVien";
            DataTable dt = new DataTable();
            dt = da.GetTable(sql);
            return dt;
        }
        public void insertnhanvien(string mnv, string tnv, string ns, string gt, string dc, string sdt)
        {
            string sql = "insert NhanVien values('" + mnv + "',N'" + tnv + "','" + ns + "',N'" + gt + "',N'" + dc + "',N'" + sdt + "')";
            da.Excutenonquery(sql);

        }
        public void Updatenhanvien(string mnv1, string mnv, string tnv, string ns, string gt, string dc, string sdt)
        {
            string sql = "UPDATE NhanVien SET MaNV='" + mnv + "',TenNV=N'" + tnv + "',NgaySinh='" + ns + "',GioiTinh=N'" + gt + "',DiaChi=N'" + dc + "',SoDienThoai='" + "'where MaNV='" + mnv1 + "'";
            da.Excutenonquery(sql);

        }
        public void Deletenhanvien(string mnv_d)
        {
            string sql = "DELETE NhanVien WHERE MaNV='" + mnv_d + "'";
            da.Excutenonquery(sql);

        }
    }
}
